﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SetCTI.aspx.cs" Inherits="SetCTI" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%--弹出窗口，设定检验项--%>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
 <META   HTTP-EQUIV="Pragma"   CONTENT="no-cache">   
   <META   HTTP-EQUIV="Cache-Control"   CONTENT="no-cache">   
   <META   HTTP-EQUIV="Expires"   CONTENT="0"> 
    <title>设置检验项</title>
        <base target="_self"/>
        <link href="css/default.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="Js/jquery-1.3.1.min.js"></script>
    <script language="javascript" type="text/javascript">

        /*更换显示样式*/
        function setTab(name,cursel,n)
        {
            for(i=1;i<=n;i++)
            {
                var menu=document.getElementById('one'+i).firstChild;
                if(menu.className=="selected")
                {
                    menu.className="selected";
                }
                else
                {
                    menu.className=i==cursel?"hover":"";
                }
            }
        }
    
        function pageLoad(sender, args)
        {
           if(args.get_isPartialLoad())
           {
               SetInputClass();
           }
        }

        $(document).ready(SetInputClass);
　　　　
　　　　function SetInputClass() {
            $(":text").hover
            (
                  function() {
                      $(this).addClass("texthover");
                  },
                  function() {
                      $(this).removeClass("texthover");
                  } 
             );
             
             $(":submit").addClass("button");
         }
    </script>
</head>
<body style="background-color:White;">
    <form id="form1" runat="server">
     <h2>
       为合同<asp:Label ID="LabelReportID" runat="server"></asp:Label>设定检验项</h2>
       <hr />
    <div>
             <ajaxToolkit:ToolkitScriptManager ID="AjaxScriptManager" runat="server" EnableScriptGlobalization="true"
                    EnableScriptLocalization="true">
                </ajaxToolkit:ToolkitScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table width="100%">
                <tr>
                    <td style="width: 100px" valign="top">
                        <asp:TreeView ID="tvTestCatalog" runat="server" ImageSet="Arrows" OnSelectedNodeChanged="TreeView1_SelectedNodeChanged">
                            <ParentNodeStyle Font-Bold="False" />
                            <HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" />
                            <SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD" HorizontalPadding="0px"
                                VerticalPadding="0px" />
                            <NodeStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="Black" HorizontalPadding="5px"
                                NodeSpacing="0px" VerticalPadding="0px" />
                        </asp:TreeView>
                    </td>
                    <td style="width:300px" valign="top">
                    <strong>请单击目录查看可供选择的检验项目</strong>
                        <asp:GridView Width="100%" ID="GridViewTestItem" runat="server" AutoGenerateColumns="False"
                            BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px"
                            CellPadding="4" DataKeyNames="Item_Code">
                            <RowStyle BackColor="White" ForeColor="#003399" />
                            <Columns>
                                <asp:BoundField DataField="Item_Code" HeaderText="检验项代码" />
                                <asp:BoundField DataField="Test_Ctg_Name" HeaderText="检验项名称" />
                                <asp:BoundField DataField="Price" HeaderText="价格" />
                                <asp:TemplateField HeaderText="操作">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="GvSelected" runat="server" OnClick="GridViewTestItemSelected_Click">选择</asp:LinkButton>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
                            <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
                            <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                            <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
                        </asp:GridView>
                    </td>
                </tr>
            </table>
            <br />
            <%--已经选择的项--%>
            <hr />
            <table>
                <tr>
                    <td>
                    <strong>已选定的检验项</strong>
                      <asp:GridView Width="100%" ID="GridViewSelected" runat="server" AutoGenerateColumns="False"
                            CellPadding="4" ForeColor="#333333" GridLines="None" DataKeyNames="Co_Item_ID">
                            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                            <Columns>
                                <asp:BoundField DataField="Item_Code" HeaderText="检验项代码" />
                                <asp:BoundField DataField="Item_Title" HeaderText="检验项名称" />
                                <asp:BoundField DataField="Price" HeaderText="价格" />
                                <asp:TemplateField HeaderText="操作">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="GvDelete" runat="server" OnClick="GridViewTestItemRemoveSelected_Click">移除</asp:LinkButton>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="#990000" ForeColor="White" Font-Bold="True" />
                            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                          <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td>
                        合计：<asp:TextBox ID="TextBoxTotalPrice" ReadOnly="true" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                    折扣率：<asp:TextBox ID="TextBoxDiscountRate" runat="server" Width="96px">100</asp:TextBox>
                    <asp:Button
                        ID="BtnSetDiscountRate" runat="server" Text="设定" OnClick="BtnSetDiscountRate_Click" />
                    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server"
            TargetControlID="TextBoxDiscountRate"
            Mask="999"
            MessageValidatorTip="true"
            OnFocusCssClass="MaskedEditFocus"
            OnInvalidCssClass="MaskedEditError"
            MaskType="Number"
            InputDirection="RightToLeft"
            AcceptNegative="Left"
            DisplayMoney="None"
            ErrorTooltipEnabled="True" />
        <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator1" runat="server"
            ControlExtender="MaskedEditExtender1"
            ControlToValidate="TextBoxDiscountRate"
            IsValidEmpty="False"
            MaximumValue="100"
            EmptyValueMessage="数值不可为空"
            InvalidValueMessage="数值无效"
            MaximumValueMessage="数值 > 100"
            MinimumValueMessage="数值 < 0"
            MinimumValue="0"
            Display="Dynamic"
            TooltipMessage="输入的数值必需在0-100之间"
            EmptyValueBlurredText="*"
            InvalidValueBlurredMessage="*"
            MaximumValueBlurredMessage="*"
            MinimumValueBlurredText="*"
            ValidationGroup="MKE" />
                    
                    </td>
                </tr>
                <tr>
                    <td>
                     最终价格：<asp:TextBox ID="TextBoxCharge" runat="server" Width="130px" Height="16px" ValidationGroup="MKE" />
          <asp:Button ID="BtnSetTotalPrice" runat="server" Text="设定" OnClick="BtnSetCharge_Click" />
        <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender2" runat="server"
            TargetControlID="TextBoxTotalPrice"
            Mask="9,999,999.99"
            MessageValidatorTip="true"
            OnFocusCssClass="MaskedEditFocus"
            OnInvalidCssClass="MaskedEditError"
            MaskType="Number"
            InputDirection="RightToLeft"
            AcceptNegative="Left"
            DisplayMoney="Left"
            ErrorTooltipEnabled="True" 
            />
        <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator2" runat="server"
            ControlExtender="MaskedEditExtender2"
            ControlToValidate="TextBoxTotalPrice"
            IsValidEmpty="False"
            MaximumValue="12000"
            EmptyValueMessage="数值不可为空"
            InvalidValueMessage="数值无效"
            MaximumValueMessage="数值 > 9999999"
            MinimumValueMessage="数值 < 0"
            MinimumValue="0"
            Display="Dynamic"
            TooltipMessage="输入的数值必需大于0，小于9999999"
            EmptyValueBlurredText="*"
            InvalidValueBlurredMessage="*"
            MaximumValueBlurredMessage="*"
            MinimumValueBlurredText="*"
            ValidationGroup="MKE" />
                        <asp:Label ID="labelInfo" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
                <tr><td>
                <input type="button" onclick="javascript:self.close();" value="确定" id="btnReturn"/>
               <%-- <asp:Button ID="btnReturn" runat="server" Text="确定" OnClick="btnReturn_Click" Width="107px" />--%>
                </td></tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
